MenuParameters Methods
An object defining methods for the MenuParameters class.
GetValueAsBool(key)
Retrieves the value associated with the specified key as a bool
.
Parameters:
key (required): string
The key to retrieve the value from.
Returns:
Type: bool
The value associated with the specified key as abool
. If the value is not a validbool
, it returnsdefault(bool)
.
This is a sync method. Method runs synchronously.
GetValueAsByte(key)
Retrieves the value associated with the specified key as a byte
.
Parameters:
key (required): string
The key to retrieve the value from.
Returns:
Type: byte
The value associated with the specified key as abyte
. If the value is not a validbyte
, it returnsdefault(byte)
.
This is a sync method. Method runs synchronously.
GetValueAsChar(key)
Retrieves the value associated with the specified key as a char
.
Parameters:
key (required): string
The key to retrieve the value from.
Returns:
Type: char
The value associated with the specified key as achar
. If the value is not a validchar
, it returnsdefault(char)
.
This is a sync method. Method runs synchronously.
GetValueAsShort(key)
Retrieves the value associated with the specified key as a short
.
Parameters:
key (required): string
The key to retrieve the value from.
Returns:
Type: short
The value associated with the specified key as ashort
. If the value is not a validshort
, it returnsdefault(short)
.
This is a sync method. Method runs synchronously.
GetValueAsInt(key)
Retrieves the value associated with the specified key as a int
.
Parameters:
key (required): string
The key to retrieve the value from.
Returns:
Type: int
The value associated with the specified key as aint
. If the value is not a validint
, it returnsdefault(int)
.
This is a sync method. Method runs synchronously.
GetValueAsString(key)
Retrieves the value associated with the specified key as a string
.
Parameters:
key (required): string
The key to retrieve the value from.
Returns:
Type: string
The value associated with the specified key as astring
. If the value is not a validstring
, it returnsdefault(string)
.
This is a sync method. Method runs synchronously.
GetValueJsonAsType<T>(key)
Deserializes a JSON string stored under the given key into an object of type T
.
Parameters:
key (required): string
The key to retrieve the value from.
Generics:
Type: T
A generic type parameter that allows the method's return type to be dynamically specified when called, adapting the result to that specific type.
Returns:
Type: T
The deserialized object ordefault(T)
if conversion fails.
This is a sync method. Method runs synchronously.
GetValueAsDecimal(key)
Retrieves the value associated with the specified key as a decimal
.
Parameters:
key (required): string
The key to retrieve the value from.
Returns:
Type: decimal
The value associated with the specified key as adecimal
. If the value is not a validdecimal
, it returnsdefault(decimal)
.
This is a sync method. Method runs synchronously.
GetValueAsUlong(key)
Retrieves the value associated with the specified key as a ulong
.
Parameters:
key (required): string
The key to retrieve the value from.
Returns:
Type: ulong
The value associated with the specified key as aulong
. If the value is not a validulong
, it returnsdefault(ulong)
.
This is a sync method. Method runs synchronously.
GetValueAsDouble(key)
Retrieves the value associated with the specified key as a double
.
Parameters:
key (required): string
The key to retrieve the value from.
Returns:
Type: double
The value associated with the specified key as adouble
. If the value is not a validdouble
, it returnsdefault(double)
.
This is a sync method. Method runs synchronously.
GetValueAsT<T>(key)
Retrieves the value associated with the specified key and converts it to the specified type T
.
Parameters:
key (required): string
The key to retrieve the value from.
Generics:
Type: T
A generic type parameter that allows the method's return type to be dynamically specified when called, adapting the result to that specific type.
Returns:
Type: T
The converted value ordefault(T)
if conversion fails.
This is a sync method. Method runs synchronously.
GetValueJsonAsType(key, type)
Deserializes a JSON string stored under the given key into an object of the specified type.
Parameters:
key (required): string
The key to retrieve the value from.
type (required): string
The target type for deserialization.
Returns:
Type: object
The deserialized object ordefault(type)
if conversion fails.
This is a sync method. Method runs synchronously.
GetValueAsTimeSpan(key)
Retrieves the value associated with the specified key as a TimeSpan
.
Parameters:
key (required): string
The key to retrieve the value from.
Returns:
Type: TimeSpan
The value associated with the specified key as aTimeSpan
. If the value is not a validTimeSpan
, it returnsdefault(TimeSpan)
.
This is a sync method. Method runs synchronously.
GetValueAsUshort(key)
Retrieves the value associated with the specified key as a ushort
.
Parameters:
key (required): string
The key to retrieve the value from.
Returns:
Type: ushort
The value associated with the specified key as aushort
. If the value is not a validushort
, it returnsdefault(ushort)
.
This is a sync method. Method runs synchronously.
GetValueAsFloat(key)
Retrieves the value associated with the specified key as a float
.
Parameters:
key (required): string
The key to retrieve the value from.
Returns:
Type: float
The value associated with the specified key as afloat
. If the value is not a validfloat
, it returnsdefault(float)
.
This is a sync method. Method runs synchronously.
GetValueAsUint(key)
Retrieves the value associated with the specified key as a uint
.
Parameters:
key (required): string
The key to retrieve the value from.
Returns:
Type: uint
The value associated with the specified key as auint
. If the value is not a validuint
, it returnsdefault(uint)
.
This is a sync method. Method runs synchronously.
GetValueAsDateTime(key)
Retrieves the value associated with the specified key as a DateTime
.
Parameters:
key (required): string
The key to retrieve the value from.
Returns:
Type: DateTimeOffset
The value associated with the specified key as aDateTime
. If the value is not a validDateTime
, it returnsdefault(DateTime)
.
This is a sync method. Method runs synchronously.
GetValueAsDateTimeOffset(key)
Retrieves the value associated with the specified key as a DateTimeOffset
.
Parameters:
key (required): string
The key to retrieve the value from.
Returns:
Type: DateTimeOffset
The value associated with the specified key as aDateTimeOffset
. If the value is not a validDateTimeOffset
, it returnsdefault(DateTimeOffset)
.
This is a sync method. Method runs synchronously.
GetValueAsSbyte(key)
Retrieves the value associated with the specified key as a sbyte
.
Parameters:
key (required): string
The key to retrieve the value from.
Returns:
Type: sbyte
The value associated with the specified key as asbyte
. If the value is not a validsbyte
, it returnsdefault(sbyte)
.
This is a sync method. Method runs synchronously.
GetValueAsLong(key)
Retrieves the value associated with the specified key as a long
.
Parameters:
key (required): string
The key to retrieve the value from.
Returns:
Type: long
The value associated with the specified key as along
. If the value is not a validlong
, it returnsdefault(long)
.
This is a sync method. Method runs synchronously.